function Range(from, to)
{
	this.from = from;
	this.to = to;
}

Range.prototype = {
	include: function(x) {return this.from <= x && this.to >= x; },
	foreach: function(f) {
		for(var x = Math.ceil(this.from); x <= this.to; ++x) f(x);
	},
}

var r = new Range(1, 3);
console.log(r);
console.log(r.include(2));
r.foreach(console.log);
